Program to display the all tables in Oracle Database

import java.sql.*;
public class Sample
{
public static void main(String args[])
{
Connection con=null;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:vision","scott","tiger");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery(“select object_name from
user_objects where object_type=’TABLE’”);
while(rs.next())
{
System.out.println(rs.getString(1));
}
rs.close();
st.close();
con.close();
}
catch(ClassNotFoundException e)
{
e.printStackTrace();
}
catch(SQLException e)
{
e.printStackTrace();
}
finally
{
try
{
if(con!=null)
con.close();
}
catch(SQLException e)
{
e.printStackTrace();
}
}
}
}